package com.howard.webapp.familymanagement.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.howard.webapp.familymanagement.domain.User;
import com.howard.webapp.familymanagement.repository.BaseRepository;
import com.howard.webapp.familymanagement.repository.UserRepository;
import com.howard.webapp.familymanagement.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserRepository repository;
	
	public BaseRepository<User,Long> getRepository() {
		return repository;
	}

//	@Override
//	public void save(User user) {
//		repository.save(user);
//		
//	}
//
//	@Override
//	public boolean findById(Long id) {
//		User user = repository.findOne(id);
//		return user != null ? true:false;
//	}
//
//	@Override
//	public List<User> findAll() {
//		Sort sort = new Sort(Direction.ASC, "id");
//		PageRequest page = new PageRequest(0, 20,sort);
//		return repository.findAllWithPage(page);
//	}
//
//	@Override
//	public Long countAll() {
//		return repository.count();
//	}
//
//	@Override
//	public Page<User> findAllWithPage(PageRequest request) {
////		PageRequest request =
////	            new PageRequest(pageNumber - 1, PAGE_SIZE, Sort.Direction.DESC, "startTime");
//        return repository.findAll(request);
//	}

	
}